<template>
	<view class="container">
		<text>这个页面隐藏了导航栏，具体配置参见page.json中的`pages/class2/616`文件</text>
		<text>111</text>
		<view class="">
			<input type="digit" v-model="val1" />
			<uni-badge text="2" type=""></uni-badge>
			<button type="primary" size="mini"
				:disabled="disabled" @tap="tapHandler" @longtap="longtapHandler">click</button>
		</view>
		<view class="">
			<image src="/static/shuijiao.jpg" fade-show="true"></image>
		</view>
		<view>
			<view class="page-body">
				<view class="page-section page-section-gap">
					<map style="width: 100%; height: 300px;" :latitude="latitude" :longitude="longitude" :markers="covers">
					</map>
				</view>
			</view>
		</view>
		<view class="">
			<view class="">
				可填可选的输入框：
			</view>
			<uni-combox label="所在城市" :candidates="candidates"
				placeholder="所在城市" v-model="city"></uni-combox>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				disabled: false,
				val1: '',
				// 地图相关
				id:0, // 使用 marker点击事件 需要填写id
				title: 'map',
				latitude: 29.909,
				longitude: 86.39742,
				covers: [{
					latitude: 39.909,
					longitude: 116.39742,
					iconPath: '../../../static/location.png'
				}, {
					latitude: 39.90,
					longitude: 116.39,
					iconPath: '../../../static/location.png'
				}],
				// 候选字段
				candidates: [
					'北京',
					'南京',
					'东京',
					'西京',
					'郑州',
					'亳州',
					'邓州',
					'杭州'
				],
				city: ''
			}
		},
		onLoad(e) { 
			console.log(e.age)
		},
		methods: {
			tapHandler() {
				this.disabled = true;
				console.log(this.val1);
				uni.navigateTo({
					url: '../index/index?age=' + this.val1
				})
			},
			// 长按的处理方式
			longtapHandler() {
				console.log(777);
				uni.request({
					url: 'https://api.imjad.cn/cloudmusic/?id=28012031',
					method: 'GET',
					success(res) {
						console.log(res.data)
					}
				})
			}
		}
	}
</script>

<style>
	.container {
		padding: 20px;
		font-size: 14px;
		line-height: 24px;
	}
</style>
